package org.jmpo;

import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;

public class ParameterizedEnumMethodTest {
    @ParameterizedTest
    @EnumSource(value = EnumMethod.Month.class, names = {"Jan", "Feb", "Jul", "Aug"})
    public void daysInMonthTest(EnumMethod.Month m) {
        var actual = EnumMethod.daysInMonth(m);
        switch (m) {
            case Jan -> assertEquals(31, actual);
            case Feb -> assertEquals(28, actual);
            case Jul -> assertEquals(31, actual);
            case Aug -> assertEquals(31, actual);
            default -> throw new RuntimeException("Unreachable code"); 
        }
    }

}
